package showtime.framework.events
{
	import flash.events.Event;
	import flash.events.IOErrorEvent;
	import flash.events.SecurityErrorEvent;

	public class SocketEvent extends Event
	{
		public static const SECURITY_ERROR:String = SecurityErrorEvent.SECURITY_ERROR;
		
		public static const IO_ERROR:String = IOErrorEvent.IO_ERROR;
		
		public static const DECODE_ERROR:String = "DECODE_ERROR";
		
		public static const HEART_BEAT_ERROR:String = "HEART_BEAT_ERROR";
		
		public static const CLOSE:String = Event.CLOSE;
		
		public static const CONNECT:String = Event.CONNECT;
		
		public var data:Object = null;
		
		public function SocketEvent(type:String, data:Object = null, bubbles:Boolean = false, cancelable:Boolean = false)
		{
			super(type, bubbles, cancelable);
			
			this.data = data;
		}
		
		override public function toString():String
		{
			return formatToString("SocketEvent", "type", "bubbles");
		}
		
		override public function clone():Event
		{
			return new SocketEvent(type, data);
		}
	}
}